package sg.edu.nus.iss.vmcs.ui;

import sg.edu.nus.iss.vmcs.system.Environment;
import sg.edu.nus.iss.vmcs.ui.factory.UIComponentAbstractFactory;
import sg.edu.nus.iss.vmcs.ui.factory.awt.AwtUIComponentAbstractFactory;

public class FactoryMaker {
	
	private static UIComponentAbstractFactory abstractFactory = null;
	
	public static UIComponentAbstractFactory getFactory() {
		if(abstractFactory == null) {
			// Get the UI toolkit environment from property file
			String uiToolkitType = Environment.getUiToolkitType();
			if(uiToolkitType.equals("AWT")) {
				abstractFactory = AwtUIComponentAbstractFactory.getInstance();
			}
		}
		return abstractFactory;
	}
}
